/**
 * 
 */
package io.dora.demo;

import io.dora.conf.ProtocolConfig;
import io.dora.conf.ProviderConfig;
import io.dora.conf.RegistryConfig;

/**
 * @author zhaohongbo
 *
 */
public class DemoAPIProvider {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		HelloRpc helloRpc = new HelloRpcImpl();
		ProtocolConfig protocolConfig = new ProtocolConfig();
		protocolConfig.setName("");
		RegistryConfig registryConfig = new RegistryConfig();
		registryConfig.setUrl("127.0.0.1:2181");
		ProviderConfig<HelloRpc> providerConfig = new ProviderConfig<HelloRpc>();
		providerConfig.setRegistry(registryConfig.getRegistry());
		providerConfig.setInterfaceClass(HelloRpc.class);
		providerConfig.setGroup("jshop_test");
		providerConfig.setRef(helloRpc);
		providerConfig.setProtocol(protocolConfig.getProtocol());
		providerConfig.export();
		
		synchronized (DemoAPIProvider.class) {
            while (true) {
                try {
                	DemoAPIProvider.class.wait();
                } catch (InterruptedException e) {
                }
            }
        }
	}

}
